//
//  AlertActionViewController.swift
//  testRxSwift
//
//  Created by 火星人 on 2017/7/27.
//  Copyright © 2017年 火星人. All rights reserved.
//

import UIKit
import RxCocoa
import RxSwift
import Action

class AlertActionViewController: BaseViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        

        self.view.addTapWithHandle { [weak self] (tap) in
            
            let alertController = UIAlertController(title: "validate", message: "this message shows ok !", preferredStyle: .alert)
            var ok = UIAlertAction.Action("OK", style: .default)
            ok.rx.action = CocoaAction {
                print("Alert's OK button was pressed")
                return .empty()
            }
            alertController.addAction(ok)
            self?.present(alertController, animated: true, completion: nil)
        }
    }

}
